<template>
  <van-grid :column-num="5">
    <van-grid-item
      v-for="item in channelArr"
      :key="item.id"
      :icon="item.icon_url"
      :text="item.name"
      @click="btn(item.id)"
    />
  </van-grid>
</template>

<script>
import { Getgory } from "../../https/http";
import {  mapMutations } from "vuex";
export default {
  name: "Grid",
  data() {
    return {
      value: "",
    };
  },
  props: ["channelArr"],
  methods: {
    btn(num) {
      Getgory({ id: num }).then((res) => {
        // console.log(res);
        this.chanGe()
        console.log(num);
        this.$router.push({ name: "banner", params: { data: res.data , index:num } });
      });
    },
    ...mapMutations(["chanGe"])
  },
};
</script>

<style>
</style>